#ifndef SEMATHREAD_H_
#define SEMATHREAD_H_
#include <semaphore.h>
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#include <pthread.h>
#include <unistd.h>
#include <fcntl.h>

#define N 100                    /* number of slots in the buffer */
#define TERM_NUM 999
#define SIZE 1
#define PERMS 0664

char produce_item();
void insert_item(char);

char remove_item();
void consume_item(char);

void* producer(void *arg);
void* consumer(void *arg);


char items[N];

sem_t mutex;                /* controls access to control section*/
sem_t empty;                 /* counts empty buffer slot*/
sem_t full;                /*counts full buffer slots*/

int fd;

int in;

#endif
